package com.bridgeintelligent.tag.configs;

import com.bridgeintelligent.tag.interceptors.ResubmitInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author：liwei
 * @Date：2023/9/21 09:49
 * @Desc： 配置拦截路径
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Autowired
    private ResubmitInterceptor resubmitInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 配置拦截类
        registry.addInterceptor(resubmitInterceptor)
                // 设置拦截路径URL
                .addPathPatterns("/api/dimFree/addById**").order(0);
    }
}
